﻿module SQLParser

open Ast
open parser
open lexer

let tokenizeText text = 
    let lexbuf = Lexing.LexBuffer<_>.FromString text
    lexbuf

let token lexbuf =
    lexer.token lexbuf

let parseText text =
    let lexbuf = Lexing.LexBuffer<_>.FromString text
    try
        parser.start lexer.token lexbuf
    with e ->
        let pos = lexbuf.EndPos
        failwithf "Error near line %d, character %d\n" pos.Line pos.Column
